home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / ohlcpio.zip / MAKEFILE < prev    next >
Text File  |  1990-07-07  |  3KB  |  81 lines

  1. # Makefile for GNU cpio.
  2. # Copyright (C) 1988, 1989, 1990 Free Software Foundation, Inc.
  3.  
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 1, or (at your option)
  7. # any later version.
  8.  
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. # GNU General Public License for more details.
  13.  
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; if not, write to the Free Software
  16. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. SHELL = /bin/sh
  19. # If you use gcc, you should either run the fixincludes script that
  20. # comes with it or else use gcc with the -traditional option.  Otherwise
  21. # ioctl calls will be compiled incorrectly on some systems.
  22. CC = gcc
  23.  
  24. # DEFS can contain:
  25. # -DUSG            System V strings, headers, ndir.h.
  26. # -DDIRENT        If you have dirent.h.
  27. # -DSYSNDIR        Old Xenix systems (selects sys/ndir.h).
  28. # -DMTIO_MISSING    If you lack sys/mtio.h.
  29. # -DVPRINTF_MISSING    If you lack vprintf function (but have _doprnt).
  30. # -DBCOPY_MISSING    If you lack bcopy function.
  31. # -DMKDIR_MISSING    If you lack mkdir system call.
  32. DEFS = -I. -DDIRENT
  33. CFLAGS = -g $(DEFS)
  34.  
  35. LDFLAGS = -g
  36.  
  37. LIBS = #-ldir -lx
  38.  
  39. SRCS = copyin.c copyout.c copypass.c dstring.c glob.c global.c main.c \
  40.     util.c error.c getopt.c getopt1.c filemode.c version.c
  41. OBJS = copyin.o copyout.o copypass.o dstring.o glob.o global.o main.o \
  42.     util.o error.o getopt.o getopt1.o filemode.o version.o
  43. HDRS = cpio.h dstring.h extern.h getopt.h
  44. DISTFILES = $(SRCS) $(HDRS) COPYING ChangeLog Makefile README
  45.  
  46. all:    cpio
  47. .PHONY: all
  48.  
  49. cpio:    $(OBJS)
  50.     $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
  51.  
  52. copyin.o:    cpio.h dstring.h extern.h
  53. copyout.o:    cpio.h dstring.h extern.h
  54. copypass.o:    cpio.h dstring.h extern.h
  55. dstring.o:    dstring.h
  56. global.o:    cpio.h dstring.h
  57. main.o:        cpio.h dstring.h extern.h
  58. util.o:        extern.h
  59.  
  60. LINT:    $(SRCS) $(HDRS)
  61.     lint $(DEFS) $(SRCS) > LINT
  62.  
  63. tags:    $(SRCS)
  64.     ctags $(SRCS)
  65.  
  66. TAGS:    $(SRCS)
  67.     etags $(SRCS)
  68.  
  69. dist:
  70.     echo cpio-`sed -e '/version_string/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q < version.c` > .fname
  71.     rm -rf `cat .fname`
  72.     mkdir `cat .fname`
  73.     ln $(DISTFILES) `cat .fname`
  74.     tar chZf `cat .fname`.tar.Z `cat .fname`
  75.     rm -rf `cat .fname` .fname
  76. .PHONY: dist
  77.  
  78. clean:
  79.     rm -f cpio *.o core tags TAGS a.out
  80. .PHONY: clean
  81.